package com.org.engine.baseengine.dao;

import com.org.engine.baseengine.domain.ActivityRule;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

import java.util.List;


/**
 * @author lizy
 */
@Component
@Mapper
public interface ActivityRuleMapper {

    @Select("  select \n" +
            "      id, task_id, event, rule_value, priority, awardee_type, send_award_times, create_by,\n" +
            "      create_time, update_by, update_time, is_delete, is_sms_notice\n" +
            "    from activity_rule\n" +
            "    where id = #{id}")
    ActivityRule selectByPrimaryKey(Integer id);

    @Select(" select\n" +
            "        id, task_id, event, rule_value, priority, awardee_type, send_award_times, create_by,\n" +
            "        create_time, update_by, update_time, is_delete, is_sms_notice\n" +
            "        from activity_rule WHERE is_delete=0")
    List<ActivityRule> selectAll();

}